lmomIDF_vignette_004.RmdIntensity-duration-frequency (IDF) curves usefully quantify extreme precipitation over various duration, e.g. from 1 to 360 hours, and return periods for engineering design, e.g. the interest in the time concentration or time-structure of the rainfall. (e.g. Courty et al. (2019),Sun et al. (2019),Markiewicz (2021)) Among the different mathematical formulations used in literature (CCC), the most commomt and used here in thiss package is the following (Koutsoyiannis, Kozonis, and Manetas (1998)): where is precipitation intensity [mm/hr or mm/day] , is the duration of the extreme precipitation (storm) event, and is a coefficient depending on return period or probability/frequency (where $f=1-{1 /over T$ where studying storm and flood events) and is an exponent assumed to be constant. The key concepts behind this theory are they:
precipitation duration depth () with a fixed return period and a short duration cannot be higher than the depth of an event with a longer duration and the same return period;
Probability distribution of annual maximum precipitation average intensity maintains constant properties (e.g. parametric definition) for different event time duration only some moments or parameters are scaled with duration.
Therefore annual maxima precipitation are collected from daily or hourly time series; for each duration a probability distributions (e.g. a GEV distribution (Wikipedia contributors (2022))) is fitted through a Maximum Likelihood Method or a L-Moment Method; goodness-of-fit is verified with a statistical test (e.g. Kolgorov-Smirnov test (Marsaglia, Tsang, and Wang (2003))); some moments and/or parameter are scaled with duration through a regression (e.g. a log-LM model); a probability distribution with new moments’ and parameters’ values is estimated for each duration; it can be tested versus original maxima time series. This package uses L-Moment method (Hosking (2019),Cordano (2022)) for the fit of the probability distribution. Recently, Heidari et al. (2020) extend also the concepts of IDF curves to droughts. This aspect can be used in this package but requires further investigations.
Here is an application of use of the package with ‘chiavari’ (see dataset documentation)(Museo Scientifico G. Sanguineti - G. Leonardini (n.d.),ARPAL (n.d.)):
data(chiavari)
help(chiavari)
library(lmomIDF)
#> Loading required package: lmomPi
#> Loading required package: lmom
#> Loading required package: stringr
#> Loading required package: lubridate
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
data(chiavari)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(magrittr)
# years <- 1937:2020
# gsod_rds <- "/home/ecor/local/rpackages/jrc/lmomIDF/inst/ext_data/gsod_623180-99999.rds"
# cond <- file.exists(gsod_rds)
# if (!cond) {
# gsod <- get_GSOD(years=years,station="623180-99999") ##ALEXANDRIA INTL EG 623180-99999
# saveRDS(gsod,file=gsod_rds)
# } else {
# gsod <- readRDS(file=gsod_rds)
# }
#####
#####
prec <- chiavari %>% dplyr::select(time,value,centralina,granularity_hr) ## %>%
## mutate(YEARMODA=as.Date(YEARMODA,format="%Y-%m-%d"))
knitr::kable(rbind(head(prec),tail(prec)))| time | value | centralina | granularity_hr | |
|---|---|---|---|---|
| 1 | 1883-12-01 22:00:00 | 0 | t | 24 |
| 2 | 1883-12-01 23:00:00 | 0 | t | 24 |
| 3 | 1883-12-02 00:00:00 | 0 | t | 24 |
| 4 | 1883-12-02 01:00:00 | 0 | t | 24 |
| 5 | 1883-12-02 02:00:00 | 0 | t | 24 |
| 6 | 1883-12-02 03:00:00 | 0 | t | 24 |
| 1165070 | 2022-12-31 20:00:00 | 0 | arpal | 1 |
| 1165071 | 2022-12-31 21:00:00 | 0 | arpal | 1 |
| 1165072 | 2022-12-31 22:00:00 | 0 | arpal | 1 |
| 1165073 | 2022-12-31 23:00:00 | 0 | arpal | 1 |
| 1165074 | 2023-01-01 00:00:00 | 0 | arpal | 1 |
| 1165075 | 2023-01-01 01:00:00 | 0 | arpal | 1 |
### Dataset preparation
## insertion of rows so that all instants are equidistant (i.e. there is a constant time step)
## inserting any NA values of precipitation intensity
dds <- range(prec$time)
## See GSODR documentation
yymmddhhs <- seq(from=dds[1],to=dds[2],by="hour")
prec <- data.table::data.table(time=yymmddhhs) %>% full_join(prec)
#> Joining with `by = join_by(time)`
prec$value[is.na(prec$value)] <- 0
## TO COMPLETE
##
prec <- prec ##%>% group_by(time,centralina) %>% summarize(value=max(value,na.rm=TRUE),granularity_hr=max(granularity_hr,na.rm=TUE)) %>% ungroup() Time series can be visualized as follows:
library(zoo)
#>
#> Attaching package: 'zoo'
#> The following objects are masked from 'package:base':
#>
#> as.Date, as.Date.numeric
library(dygraphs)
time <- prec$time
precz <- prec$value %>% as.zoo()
index(precz) <- time
main="PRECIPITATION Vs TIME"
ylab="precipitation intensity [mm/hr]"
xlab="time"
dyd <- dygraph(precz,main=main,ylab=ylab,xlab=xlab) %>% dyRangeSelector()
dyd